package com.itheima.work1123;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class Text {
    public static void main(String[] args) throws IOException {
        List<Student> stulist = new ArrayList<>();
        stulist.add(new Student("张三", "男", "20", "88"));
        stulist.add(new Student("李四", "女", "19", "99"));
        FileWriter fw = new FileWriter(new File("student.txt"));
        for (Student s : stulist) {
            fw.write(s.getName() + "," + s.getSex() + "," +
                    s.getAge() + "," + s.getScore() + System.lineSeparator());
        }
        fw.close();
    }
}
